﻿
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>宏大远程维护系统</title>
    <script src="../Content/scripts/jquery-1.11.1.min.js"></script>
    <script src="../Content/scripts/plugins/cookie/jquery.cookie.js"></script>
    <link href="../Content/styles/font-awesome.min.css" rel="stylesheet" />
    <link href="../Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="../Content/scripts/bootstrap/bootstrap.min.js"></script>
    <script src="../Content/scripts/plugins/dialog/dialog.js"></script>
    <link href="../Content/styles/learun-ui.css" rel="stylesheet" />
    <link href="../Content/adminLTE/css/index.css" rel="stylesheet" />
    <link href="../Content/adminLTE/css/skins/_all-skins.css" rel="stylesheet" />
    <script src="../Content/scripts/utils/learun-ui.js"></script>
    <script src="CustomerInfo/CustomerJS.js"></script>
    <script src="../Content/adminLTE/index.js"></script>
    <style>
        .linkhref  {
            color: blue;
        }
        .linkhrefequ {
            color: blue;
        }
    </style>

</head>
<body class="hold-transition skin-blue sidebar-mini" style="overflow: hidden;">
    <div id="ajax-loader" style="cursor: progress; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: #fff; z-index: 10000; overflow: hidden;">
        <img src="../Content/images/ajax-loader.gif" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;" />
    </div>
    <div class="wrapper" id="wrapper">
        <!--头部信息-->
        <header class="main-header">
            <a href="#" class="logo">
                <span class="logo-mini">宏大</span>
                <span class="logo-lg"><strong>宏大远程维护系统</strong></span>
            </a>
            <nav class="navbar navbar-static-top">
                <a class="sidebar-toggle">
                    <span class="sr-only">Toggle navigation</span>
                </a>
                <div class="navbar-custom-menu">
                    <ul class="nav navbar-nav">

                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <img src="/Content/images/head/user2-160x160.jpg" class="user-image" alt="User Image">
                                <span class="hidden-xs" id="userid"></span>
                            </a>
                            <ul class="dropdown-menu pull-right">
                                <li><a href="javascript:void();" id="btn_editpsw"><i class="fa fa-user"></i>修改密码</a></li>
                                <li><a href="javascript:void();"><i class="fa fa-trash-o"></i>清空缓存</a></li>
                                <li class="divider"></li>
                                <li><a href="javascript:void();" onclick="logout()"><i class="ace-icon fa fa-power-off"></i>安全退出</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <!--左边导航-->
        <div class="main-sidebar" style="height:100%;">
            <div class="sidebar">
                <div class="user-panel">
                    <div class="pull-left image">
                        <img src="../Content/images/head/user2-160x160.jpg" class="img-circle" alt="User Image">
                    </div>
                    <div class="pull-left info">
                        <p id="username"></p>
                        <a><i class="fa fa-circle text-success"></i>在线</a>
                    </div>
                </div>

                <ul class="sidebar-menu" id="sidebar-menu">
                    <li class="header">导航菜单</li>
                </ul>

            </div>
        </div>
        <!--中间内容-->
        <div id="content-wrapper" class="content-wrapper" style="height:100%;">
            <div class="content-tabs">
                <button class="roll-nav roll-left tabLeft">
                    <i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs menuTabs">
                    <div class="page-tabs-content" style="margin-left: 0px;">
                        <a href="javascript:;" class="menuTab active" id="shouoye">欢迎首页</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right tabRight">
                    <i class="fa fa-forward" style="margin-left: 3px;"></i>
                </button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown tabClose" data-toggle="dropdown">
                        页签操作<i class="fa fa-caret-down" style="padding-left: 3px;"></i>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right">
                        <li><a class="tabReload" href="javascript:void();">刷新当前</a></li>
                        <li><a class="tabCloseCurrent" href="javascript:void();">关闭当前</a></li>
                        <li><a class="tabCloseAll" href="javascript:void();">全部关闭</a></li>
                        <li><a class="tabCloseOther" href="javascript:void();">除此之外全部关闭</a></li>
                    </ul>
                </div>
                <button class="roll-nav roll-right fullscreen"><i class="fa fa-arrows-alt"></i></button>
            </div>
            <div class="content-iframe" style="overflow: hidden;" id="content-iframe">
                <div class="mainContent" id="content-main" style="height:inherit;">
                    <iframe id="iframe" class="LRADMS_iframe" width="100%" height="100%" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div id="loading_background" class="loading_background" style="display: none;"></div>
    <div id="loading_manage" style="display: none;">
        正在拼了命为您加载…
    </div>


    <script type="text/javascript">

        $(function () {

            getSession();
            var logincustomer = getCookie("CustomerName");
            console.log(logincustomer);
            var myTimer1, myTimer2;


            if (logincustomer == '宏大') {

                $("#iframe").attr('src', '../Login/Main.html');
                $("#iframe").attr('data-id', '../Login/Main.html');
                $("#shouoye").attr('data-id', '../Login/Main.html');
                getMyMessage(getCookie('userno'));
                myTimer1 = setInterval(function () {
                    getMyMessage(getCookie('userno'));
                }, 60000);

            }
            else {
                getCustomerMaintenanceInfo(getCookie("CustomerID"));
                myTimer1 = setInterval(function () {
                    getCustomerMaintenanceInfo(getCookie("CustomerID"));
                }, 30000);
                $("#iframe").attr('src', '../Login/CustomerIndex.html');
                $("#iframe").attr('data-id', '../Login/CustomerIndex.html');
                $("#shouoye").attr('data-id', '../Login/CustomerIndex.html');
                getMyMessage(getCookie('userno'));
                myTimer2 = setInterval(function () {
                    getMyMessage(getCookie('userno'));
                }, 15000);
            }

            $("body").on("click", ".linkhref", function () {
                //console.log($("a[data-id='4001']"))
                $("a[data-id='4001']").click();
                //clearInterval(myTimer2);
            });
            $("body").on("click", ".linkhrefequ", function () {
                $("a[data-id='2002']").click();
                //clearInterval(myTimer1);
            });
        });

        function getSession() {

            $.ajax({
                type: "POST",
                url: "Login/Login.ashx?action=GetUserName",
                datatype: "json",
                success: function (data) {
                    document.getElementById("userid").innerText = decodeURI(data);
                    document.getElementById("username").innerText = decodeURI(data);
                },
                error: function (data) {

                }
            })

        }

        function logout() {
            dialogConfirm("注：您确定要安全退出本次登录吗？", function (r) {
                if (r) {
                    Loading(true, "正在安全退出...");
                    window.setTimeout(function () {
                        window.location.href = "/Login/Login.html";
                    }, 500);
                }
            });
        }

        //监听客户需要维护的设备信息
        function getCustomerMaintenanceInfo(CustomerID) {
            $.customerinfojs.getCustomerMaintenanceInfo(CustomerID);
        }
        //监听留言信息
        function getMyMessage(userno) {
            $.customerinfojs.getMyMessage(userno);
        }

        $("#btn_editpsw").click(function (event) {
            dialogOpen({
                id: "Form",
                title: '修改密码',
                url: '../Login/EditPsw.html',
                width: "750px",
                height: "400px",
                callBack: function (iframeId) {
                    top.frames[iframeId].AcceptClick();
                }
            });

        })


        //读取cookie
        function getCookie(name) {
            var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
            if (arr != null) return decodeURI(arr[2]); return null;
        };

    </script>
</body>
</html>
